#ifndef MUSIC_JSON_H
#define MUSIC_JSON_H

#include <QObject>
#include <QString>
#include <QVector>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>

struct SongInfo{
    qint64 song_id;
    QString song_name;
    qint64 singer_id;
    QString singer_name;
};

class Music_Json : public QObject
{
    Q_OBJECT
public:
    explicit Music_Json(QObject *parent = nullptr);
    
    //接口
    void setJsonData(const QString &json);
    
    //获取解析后的所有歌曲信息
    QVector<SongInfo> getSongs() const;
    
private:
    QVector<SongInfo> my_songs;
    
    void parseJson(const QString &json);
    
signals:
    
};

#endif // MUSIC_JSON_H


